<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    605. Can Place Flowers
   </h1>
   <p>
    Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they would compete for water and both would die.
   </p>
   <p>
    Given a flowerbed (represented as an array containing 0 and 1, where 0 means empty and 1 means not empty), and a number
    <b>
     n
    </b>
    , return if
    <b>
     n
    </b>
    new flowers can be planted in it without violating the no-adjacent-flowers rule.
   </p>
   <p>
    <b>
     Example 1:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> flowerbed = [1,0,0,0,1], n = 1
<b>Output:</b> True
</pre>
   <p>
    <b>
     Example 2:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> flowerbed = [1,0,0,0,1], n = 2
<b>Output:</b> False
</pre>
   <p>
    <b>
     Note:
    </b>
    <br>
   </p>
   <ol>
    <li>
     The input array won't violate no-adjacent-flowers rule.
    </li>
    <li>
     The input array size is in the range of [1, 20000].
    </li>
    <li>
     <b>
      n
     </b>
     is a non-negative integer which won't exceed the input array size.
    </li>
   </ol>
  </div>
  <div>
   <h1 class="question_title">
    605. 种花问题
   </h1>
   <p>
    假设你有一个很长的花坛，一部分地块种植了花，另一部分却没有。可是，花卉不能种植在相邻的地块上，它们会争夺水源，两者都会死去。
   </p>
   <p>
    给定一个花坛（表示为一个数组包含0和1，其中0表示没种植花，1表示种植了花），和一个数&nbsp;
    <strong>
     n&nbsp;
    </strong>
    。能否在不打破种植规则的情况下种入&nbsp;
    <strong>
     n&nbsp;
    </strong>
    朵花？能则返回True，不能则返回False。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> flowerbed = [1,0,0,0,1], n = 1
<strong>输出:</strong> True
</pre>
   <p>
    <strong>
     示例 2:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> flowerbed = [1,0,0,0,1], n = 2
<strong>输出:</strong> False
</pre>
   <p>
    <strong>
     注意:
    </strong>
   </p>
   <ol>
    <li>
     数组内已种好的花不会违反种植规则。
    </li>
    <li>
     输入的数组长度范围为 [1, 20000]。
    </li>
    <li>
     <strong>
      n
     </strong>
     是非负整数，且不会超过输入数组的大小。
    </li>
   </ol>
  </div>
 </body>
</html>